const express = require('express')
const app = express() 

// 在实际开发中用这种中间件是最多的
app.use((req, res, next)=>{
  console.log('common middleware 01')
  next()
})

app.get('/home', (req, res, next)=> {
  console.log('home path and method middleware 01')
  // res.end('home path and method middleware 01')
})

app.post('/login', (req,res,next) => {
  console.log('login path and method middleware');
})

app.listen(8000, () => {
  console.log('服务器启动成功')
})